<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAfterSalesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('c_after_sales', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('after_type')->default(0)->comment('1仅退款2退货退款3换货');
            $table->integer('order_id')->default(0)->comment('订单ID');
            $table->string('order_sn')->default(null)->comment('订单号');
            $table->integer('goods_status')->default(0)->comment('货物状态1已收货2未收货');
            $table->integer('goods_num')->default(0)->comment('商品数量');
            $table->integer('back_reason')->default(0)->comment('退款原因');
            $table->decimal('money')->comment('退款金额');
            $table->integer('coupon_id')->default(0)->comment('优惠券id');
            $table->integer('address_id')->default(0)->comment('寄件地址ID');
            $table->text('images')->default(null)->comment('上传凭证');
            $table->string('describe', 255)->default(null)->nullable()->comment('补充描述');
            $table->string('logis_company', 255)->default(null)->nullable()->comment('物流公司');
            $table->string('logis_num', 255)->default(null)->nullable()->comment('订单号');
            $table->integer('status')->default(0)->comment('注释	审核状态1审核通过2驳回');
            $table->integer('after_status')->default(0)->comment('0未完成1已完成');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('c_after_sales');
    }
}
